﻿@{
    ViewBag.Title = "UserEdit";
    Layout = "~/Views/Shared/_LayoutChild.cshtml";
}
@model Agro.Models.T_User
@section head {
    <script language="javascript" type="text/javascript">
        var _type = '@ViewBag.type';
        $(document).ready(function () {
            if (_type != null && _type == "edit")
                $("#User_Code").attr("disabled", "disabled");
        });
        function Save(t) {
            if ($("#User_Code").val() == "") {
                alert("用户编号不能为空!");
                return;
            }
            if ($("#User_Name").val() == "") {
                alert("用户姓名不能为空!");
                return;
            }
            if ($("#User_Password").val() == "") {
                alert("用户密码不能为空!");
                return;
            }
            $.funSaveForm("/SystemManage/User/Save_User", "formDetail", function (d) {
                $("#User_ID").val(d);
                parent.asyncbox.tips('保存成功!', 'success');
                MainFrame().$(MainFrame().gridId).trigger("reloadGrid");
                parent.$.close(t.id);

            });
        }
    </script>
}
<!--主窗体，页面都需要的div-->
<div class="ui-layout-center" style="overflow: hidden;">
    @using (Html.BeginForm("", "", FormMethod.Post, new Dictionary<string, object> { { "id", "formDetail" } }))
    {
        @Html.HiddenFor(model => model.User_ID) 
        @Html.HiddenFor(model => model.User_OrganizationID) 
        <div class='b-col'>
            <div class="col-name">
                <font color="red">*</font><font color="blue"> 用户编号：</font></div>
            <div class="col-input">@Html.TextBoxFor(model => model.User_Code)</div>
        </div>
        <div class='b-col'>
            <div class="col-name">
                <font color="red">*</font><font color="blue"> 用户名称：</font></div>
            <div class="col-input">@Html.TextBoxFor(model => model.User_Name)</div>
        </div>
        <div class='b-col'>
            <div class="col-name">
                <font color="red">*</font><font color="blue">用户密码：</font></div>
            <div class="col-input">@Html.TextBoxFor(model => model.User_Password)</div>
        </div>
        <div class='b-col'>
            <div class="col-name">
                性别：</div>
            <div class="col-input">
                <label>
                    男</label>@Html.RadioButtonFor(model => model.User_Sex, "男") &nbsp;&nbsp;<label>
                        女</label>@Html.RadioButtonFor(model => model.User_Sex, "女")</div>
        </div>
        <div class='b-col'>
            <div class="col-name">
                联系电话：</div>
            <div class="col-input">@Html.TextBoxFor(model => model.User_Telephone)</div>
        </div>
        <div class='b-col'>
            <div class="col-name">
                手机：</div>
            <div class="col-input">@Html.TextBoxFor(model => model.User_Phone)</div>
        </div>
        <div class='b-col'>
            <div class="col-name">
                职位：</div>
            <div class="col-input">@Html.TextBoxFor(model => model.User_Post)</div>
        </div>
        <div class='b-col'>
            <div class="col-name">
                所属单位：</div>
            <div class="col-input">@Html.TextBox("User_OrganizationName", (string)ViewBag.User_OrganizationName, new { @readonly = "readonly" })</div>
        </div>
        <div class='b-col'>
            <div class="col-name">
                说明：</div>
            <div class="col-input">@Html.TextBoxFor(model => model.User_Remark)</div>
        </div>
    }
</div>
